<?php
/**
 * Created by PhpStorm.
 * User: Yui
 * Date: 2017/5/13 0013
 * Time: 18:15
 */

namespace api\controllers;

use Yii;
use common\controllers\ApiCommonCtrl;
use common\library\comFun;
use common\services\VersionSve;

class VersionController extends ApiCommonCtrl
{
    public function actionLatest()
    {
        $appType = Yii::$app->request->get('app_type');
        $terminalType = Yii::$app->request->get('terminal_type');
        $VersionSve = new VersionSve();
        $rs = $VersionSve->getLatest(['terminal_type'=>$terminalType,'app_type'=>$appType]);
        if ($rs['code'] === 0) {
            $rs['data']->create_time = comFun::formatDate($rs['data']->create_time);
        }
        return $rs;
    }
}